﻿using MusicFluent.Pages;
using NetEasyMusic.Lib.Data;

namespace MusicFluent.MusicViews;

public partial class AlbumView : PageViewBase
{
    public AlbumView(string id)
    {
        _id = id;
        InitializeComponent();
    }

    private readonly string _id;

    protected override async void OnInitialized()
    {
        base.OnInitialized();
        using var album = new Album();
        var model = await album.GetAlbum(_id);
        BasicBlock.Text = $"{model.Type} - {model.SubType}";
        NameBlock.Text = model.Name;
        DescBlock.Text = model.Description;
        SongList.ItemsSource = model.Songs;
        Image.Source = $"{model.PicUrl}?param=300y300";
    }
}